//
//  FKNoticeExtension.swift
//  FireKnowledge
//
//  Created by 杨伟毅 on 2019/4/19.
//  Copyright © 2019 wely. All rights reserved.
//

import Foundation
import UIKit

class FKNotificationCenter: NSObject {
    class func addCenter(target:Any,selector:Selector,name:Notification.Name,obj:Any?) -> Void {
        NotificationCenter.default.addObserver(target, selector: selector, name: name, object: obj)
    }
    class func postCenter(name:Notification.Name,obj:Any?,userInfo:[AnyHashable:Any]?) -> Void {
        NotificationCenter.default.post(name: name, object: obj, userInfo: userInfo)
    }
    // 删除所有的通知
    class func removeAllObj(obj:Any) -> Void {
        NotificationCenter.default.removeObserver(obj)
    }
    class func removeObser(id:Any,name:Notification.Name,obj:Any) ->Void{
        NotificationCenter.default.removeObserver(id, name: name, object: obj)
    }
}

extension Notification.Name{
    typealias NoticeName = Notification.Name
    static let loginSuceess =  NoticeName("loginSuceess")
    
//    static let hasNe
}
